<template>
  <div>
    <header class="in-banner bg-orange">
        	<div class="bg-333 hei40">
        		<div class="container">
        			<div class="pull-left mar-t8"><span class="ft-ochre"><a href="#">数字后勤服务大厅</a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="ft-grey8"><a href="#">运驾中心</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="#">服务监督</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="#">网络报修</a></span></div>
        			<!--user login-->
    				<div class="user-box user-txt pull-right mar-t8">
    					<div class="b-login hidden"><!--未登录-->
    					  <i></i>
    					  <a href="#">登录</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="#">注册</a>
    					</div>
    					<div class="a-login"><!--已登录-->
    					  <i class="on"><img src="../../static/img/temp03.jpg" width="24" height="24" class="img-circle"></i>
    						<a href="#">Chenshangcai</a>
    					</div>
    				</div>
    				<!--/user-->
        		</div>
        	</div>
    		<div class="container hei90">
    			<!--logo-->
    			<div class="logo pull-left mar-t15"></div>
    			<!--search-->
    			<div class="search pull-right mar-t30 mar-l20">
    				<div class="input-group">
    					<input type="text" class="form-control" value="搜索商家/美食">
    					<span class="input-group-btn">
    						<button class="btn" type="button"><img src="../../static/img/search.png" width="18" height="18" alt=""/></button>
    					</span>
    				</div>
    			</div>
    			<!--/search-->
    			<!--.menu-->
    			<div class="pull-right">
    				<nav class="pull-left mar-t30" role="navigation">
    					<ul class="nav-menu nav-menu-tabs">
    						<li class="dropdown">
    							<a href="#" class="dropdown-toggle" data-toggle="dropdown">餐厅介绍</a>
    							<ul class="dropdown-menu">
    								<li><a href="#">桃园食堂</a></li>
    								<li><a href="#">橘园食堂</a></li>
    								<li><a href="#">梅园食堂</a></li>
    								<li><a href="#">杏园食堂</a></li>
    								<li><a href="#">李园食堂</a></li>
    								<li><a href="#">禾丰楼餐厅</a></li>
    								<li><a href="#">楠园一食堂</a></li>
    								<li><a href="#">楠园二食堂</a></li>
    								<li><a href="#">竹园食堂</a></li>
    							</ul>

    						</li>
    						<li><a href="#">推荐菜品</a></li>
    						<li><a href="#">我的订单</a></li>
    					</ul>
    				</nav>
    				<div class="pull-left s-cart mar-t30"><i></i><span class="pull-left">购物车</span> <em>12</em></div>
    			</div>
    			<!--/menu-->
    		</div>
        </header>
          <div class="container1060 mar-t30">
        	<div class="ft18">亲！您的购车有以下商品</div>
        	<div class="shopping-cart mar-t10">

            <div  class="order-list shop-cart-list" v-for="item in CarItems">
              <div class="title">
                <span class="fl ft-bold600 ft16" >{{item.storeName}}</span>
                <span class="fr"><a href="javascript:;" class="ft12 ft-grey8">返回商家修改</a></span>
              </div>
              <p class="clearfix"></p>
              <ul>
                <li class="clearfix">
                  <div class="fl na clearfix">商品</div>
                  <div class="fl modify">份数</div>
                  <div class="fr pri" style="width: 80px">小计（元）</div>
                </li>
              </ul>

<!--             所有菜品-->
              <ul class="bg-grey" v-for="food in CarItems.foods">
                <li class="clearfix">
                  <div class="fl na clearfix" title="精品秘制茄子盖">{{food.foodName}}</div>
                  <div class="fl modify clearfix">
                    <a href="javascript:;" class="fl minus" @click="addShopCar(ShopCarForm)">-</a>
                    <input type="text" class="fl txt-count" value=" food.count " maxlength="2">
                    <a href="javascript:;" class="fl plus" @click="addShopCar(ShopCarForm)">+</a>
                  </div>
                  <div class="fr pri"><span>¥{{food.price}}</span></div>
                </li>
<!--                <li class="clearfix">-->
<!--                  <div class="fl na clearfix" title="精品秘制茄子盖">精品秘制茄子盖</div>-->
<!--                  <div class="fl modify clearfix">-->
<!--                    <a href="javascript:;" class="fl minus">-</a>-->
<!--                    <input type="text" class="fl txt-count" value="1 " maxlength="2">-->
<!--                    <a href="javascript:;" class="fl plus">+</a>-->
<!--                  </div>-->
<!--                  <div class="fr pri"><span>¥16</span></div>-->
<!--                </li>-->
              </ul>
<!--             包装-->
              <div class="other-charge">
                <div class="clearfix packing-cost">
                  <span class="fl">包装盒</span>
                  <span class="fr boxtotalprice">¥{{item.packCost}}</span>
                </div>
                <div class="clearfix delivery-cost">
                  <span class="fl">配送费(不计入起送价)</span>
                  <span class="fr shippingfee">¥{{item.deliveryCost}}</span>
                </div>
              </div>
            </div>
            <p class="mar-t10"></p>
<!--            总价-->
            <div class="footer wid300 pull-right">
              <div class="fl">
                <div class="logo icon"></div>
                <div class="brief-order">
                  <span class="count">2</span>
                  <span class="price"><i>¥</i>{{item.totalPrice}}</span>
                </div>
              </div>
              <div class="fr">
                <input class="go-pay borderradius-2" type="submit" value="立即下单" style="display: inline-block;">
                <input type="hidden" class="order-data" name="shop_cart">
              </div>
            </div>
            <p class="clearfix"></p>
    		</div>

<!--          <div class="shopping-cart mar-t10">-->

<!--    			<div  class="order-list shop-cart-list">-->
<!--    				<div class="title">-->
<!--    					<span class="fl ft-bold600 ft16">楠园一食堂</span>-->
<!--    					<span class="fr"><a href="javascript:;" class="ft12 ft-grey8">返回商家修改</a></span>-->
<!--    				</div>-->
<!--    				<p class="clearfix"></p>-->
<!--    				<ul>-->
<!--    					<li class="clearfix">-->
<!--    						<div class="fl na clearfix">商品</div>-->
<!--    						<div class="fl modify">份数</div>-->
<!--    						<div class="fr pri" style="width: 80px">小计（元）</div>-->
<!--    					</li>-->
<!--    				</ul>-->
<!--    				<ul class="bg-grey">-->
<!--    					<li class="clearfix">-->
<!--    						<div class="fl na clearfix" title="精品秘制茄子盖">茄子盖精品秘制</div>-->
<!--    						<div class="fl modify clearfix">-->
<!--    							<a href="javascript:;" class="fl minus">-</a>-->
<!--    							<input type="text" class="fl txt-count" value="1 " maxlength="2">-->
<!--    							<a href="javascript:;" class="fl plus">+</a>-->
<!--    						</div>-->
<!--    						<div class="fr pri"><span>¥16</span></div>-->
<!--    					</li>-->
<!--    				</ul>-->
<!--    				<div class="other-charge">-->
<!--    					<div class="clearfix packing-cost">-->
<!--    					  <span class="fl">包装盒</span>-->
<!--    					  <span class="fr boxtotalprice">¥1</span>-->
<!--    					</div>-->
<!--    					<div class="clearfix delivery-cost">-->
<!--    					  <span class="fl">配送费(不计入起送价)</span>-->
<!--    					  <span class="fr shippingfee">¥0</span>-->
<!--    					</div>-->
<!--    				</div>-->
<!--    			</div>-->
<!--    			<p class="mar-t10"></p>-->
<!--    			<div class="footer wid300 pull-right" data-toggle="collapse" data-target="#demo">-->
<!--    				<div class="fl">-->
<!--    					<div class="logo icon"></div>-->
<!--    					<div class="brief-order">-->
<!--    						<span class="count">1</span>-->
<!--    						<span class="price"><i>¥</i>17</span>-->
<!--    					</div>-->
<!--    				</div>-->
<!--    				<div class="fr">-->
<!--    					<input class="go-pay borderradius-2" type="submit" value="立即下单" style="display: inline-block;">-->
<!--    					<input type="hidden" class="order-data" name="shop_cart">-->
<!--    				</div>-->
<!--    			</div>-->
<!--    			<p class="clearfix"></p>-->
<!--    		</div>-->
        	<p class="hei50">&nbsp;</p>

        	<!--footer-->
        	<footer class="line text-center ft-grey6 ft12">
        		<p class="mar-t10 mar-b20">版权所有：西南大学资产经营公司 (渝ICP 06005063号)    重庆市北碚区天生路2号    邮编：400715 </p>
        	</footer>
    	</div>
  </div>
</template>
<script>
export default {
  name: "",
  data(){
    return {
      //所有购物车
      CarItems:[],
      //所有菜品
      foodsItems:[],
      //某个购物车对象
      item: "",
      // 某个菜品对象
      food:""

    }
  },
  methods:{
    //展示所有物购车信息
    showShopCar(){
      this.$http.get("/shopping_car/showShopCar").then(resp=>{
        alert(1);
        console.log(resp);
        this.CarItems=resp.data.data
        this.foodsItems=resp.data.data.foods
      })
    },

    //新增，更新购物车
    addShopCar(ShopCarForm){
      this.$http.post("/shopping_car/addShopCar",ShopCarForm={

      }).then(resp=>{
        alert(1);
        console.log(resp);
        if (resp.data.code==200){

        }
      })
    }
  },
  //预加载
  created() {
    this.showShopCar();
  }
}
</script>

<style scoped>

</style>
